<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-bind</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>v-bind</h1>
    <hr>
    <div id="app">
        <p><img v-bind:src="srcImg" alt=""></p>
        <p><a :href="webUrl"  target="_blank">技术胖</a></p>
        <hr>
        <div :class="className">1.绑定class</div>
        <div :class="{classA:isOK}">2.绑定class中的判断</div>
        <div :class="[classA,classB]">3.绑定class中的判断</div>
        <div :class="isOK?classA:classB">3.绑定class中的三元预算符</div>
        <hr>
        <div>
            <input type="checkbox" name="" id="isOK" v-model="isOK">
            <label for="isOK">isOk={{isOK}}</label>
        </div>
         <hr>
         <div :style="{color:red,fontSize:font}">5.绑定style</div>
         <div :style="styleObject">6.对象绑定style</div>


    </div>
    <style>
        .classA{
            color: red;
        }
        .classB{
            font-size: 50px;
        }
    </style>

    <script type="text/javascript">
       var app = new Vue({
        el:'#app',
        data:{
            srcImg: 'https://img.pospal.cn/productImages/95577/f3944c44-a506-4452-bbf4-dbd0f68db8ec_200x200.png',
            webUrl: 'http://jspang.com',
            className:'classA',
            isOK: true,
            classA: 'classA',
            classB: 'classB',
            red: 'red',
            font: '20px',
            styleObject:{
                color: 'green',
                fontSize: '24px'
            }
        }
       })
    </script>
</body>
</html>